/**
 * @(#)ApkConfigController.java 2017年03月1日
 * Copyright(C) 2017 ZHEXIN IT CO.,LTD. All rights reserved.
 */
package org.jsbd.boss.action;

import java.util.List;
import java.util.Map;

import org.jsbd.boss.domian.WbUserBaseCanDoLog;
import org.jsbd.boss.service.IUserBaseCanDoLogService;
import org.jsbd.boss.common.DataGridModel;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/userBaseCanDoLog")
public class UserBaseCanDoLogController {

	public static final Logger logger = LoggerFactory.getLogger(UserBaseCanDoLogController.class);

	@Autowired
	private IUserBaseCanDoLogService userBaseCanDoLogService;

	@RequestMapping(value = "list", method = RequestMethod.GET)
	public String list(Model model) {
		return "userBaseCanDoLog/list";
	}

	@RequestMapping(value = "getListPage")
	@ResponseBody
	public Map<String, Object> getListPage(DataGridModel page, WbUserBaseCanDoLog log) throws Exception {
		return userBaseCanDoLogService.getListPage(page, log);
	}

	@RequestMapping(value = "getCanDoDetail")
	public String getCanDoDetail(Model model, String id, String base) throws Exception {
		List<WbUserBaseCanDoLog> list = userBaseCanDoLogService.getById(Long.valueOf(id), base);
		model.addAttribute("list", list);
		return "/userBaseCanDoLog/canDoDetail";
	}

}
